package com.tianji.promotion.controller;


import com.tianji.common.domain.dto.PageDTO;
import com.tianji.promotion.domain.query.CodeQuery;
import com.tianji.promotion.domain.vo.ExchangeCodeVo;
import com.tianji.promotion.service.IExchangeCodeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 兑换码 前端控制器
 * </p>
 *
 * @author LYQ
 * @since 2024-07-03
 */
@Api(tags = "兑换码管理相关接口")
@RestController
@RequestMapping("/codes")
@RequiredArgsConstructor
public class ExchangeCodeController {
    private final IExchangeCodeService codeService;

    /**
     * 优惠券兑换码分页查询
     */
    @GetMapping("/page")
    @ApiOperation("优惠券兑换码条件分页查询")
    public PageDTO<ExchangeCodeVo> queryExchangeCodePage(CodeQuery query) {
        return codeService.queryExchangeCodePage(query);
    }


}
